package codename.carrot.bomberman.network.events;

import codename.carrot.bomberman.network.interfaces.NetworkMessage;

/**
 * The event fired when a message is received from the network.
 * 
 * @author Groupa A4.
 * 
 */
public class ReceiveEvent {

	/**
	 * The client ID where the message came from.
	 */
	private int clientid;
	/**
	 * The message.
	 */
	private NetworkMessage message;

	/**
	 * Constructs a ReceiveEvent.
	 * 
	 * @param message
	 *            The message that was received.
	 * @param clientid
	 *            The ID of the client the message came from.
	 */
	public ReceiveEvent(NetworkMessage message, int clientid) {
		this.message = message;
		this.clientid = clientid;
	}

	/**
	 * Returns the client ID where the message came from.
	 * 
	 * @return The client ID where the message came from.
	 */
	public int getClientid() {
		return clientid;
	}

	/**
	 * Returns the message received from the network.
	 * 
	 * @return The message received from the newtwork.
	 */
	public NetworkMessage getMessage() {
		return message;
	}

}
